package bll.serviceimpl;

import bll.model.UserModel;
import bll.service.UserService;
import dal.dao.UserDao;
import dal.daoimpl.UserDaoImpl;
import dal.entity.User;

public class UserServiceImpl implements UserService {
    @Override
    public boolean register(UserModel userModel) {
        UserDao userDao = new UserDaoImpl();
        User user = new User(0,userModel.getName(),userModel.getPassword());
        return userDao.addUser(user);
    }

    @Override
    public boolean login(UserModel userModel) {
        UserDao userDao = new UserDaoImpl();
        User user = new User(0,userModel.getName(),userModel.getPassword());
        return userDao.exists(user);
    }
}
